<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>插槽</title>
    <script src="../js/axios.min.js"></script>
    <script src="../js/vue.js"></script>
</head>
<body>
<div id="app">
    {{msg}}
    <login><h5 slot="aa">我是用户自定义slot内容</h5> </login>
    <hr>
    <login><button slot="aa">asdasdasd</button><input type="text" slot="bb">asdasd</login>
    <hr>
    <login><input type="text"></login>
    <hr>
    <login></login>
</div>
</body>
</html>
<script>
    //slot:插槽  作用:用来扩展自定义组件让组件变得更加灵活 用来个性化订制自己的组件

    const login = {
        template: "<div><slot name='aa'><span>默认扩展</span></slot><h3>用户登录页面</h3><slot name='bb'><span>默认扩展</span></slot></div>"
    }
    const app = new Vue({
        el: "#app",   //element:元素
        data: {        //data:数据 用来vue实例对象绑定一系列数据
            msg: "slot插槽使用"
        },
        methods: {},
        computed: {},
        components: {
            login
        }
    });
</script>
